<?php

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) wangyt <wangtom365@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace App\Models;

use Illuminate\Support\Facades\DB;

class LinkModel extends BaseModel
{
    /**
     * Constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $this->table = \Config::get('admins.tablePrefix').\Config::get('admins.tableName.links');
    }

    public function get(int $id)
    {
        $where = [
            'id' => $id,
            'status' => 1,
        ];

        return DB::table($this->table)->where($where)->get();
    }
}
